package felix.actor.core;

import felix.actor.core.msg.TActorMsg;

import java.util.List;
import java.util.function.Predicate;
import java.util.function.Supplier;

public interface TActorCtx extends TActorRef {

    TActorId getSelf();

    TActorRef getParentRef();

    void tell(TActorId target, TActorMsg msg);

    void stop(TActorId target);

    TActorRef getOrCreateChildActor(TActorId actorId, Supplier<String> dispatcher, Supplier<TActorCreator> creator);

    void broadcastToChildren(TActorMsg msg);

    void broadcastToChildren(TActorMsg msg, Predicate<TActorId> childFilter);

    List<TActorId> filterChildren(Predicate<TActorId> childFilter);
}
